<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<html>
	<head>
		<%@ include file="/commons/meta.jsp"%>
	</head>

	<body>
		<table width="100%" height="100%" border="0" cellpadding="0"
			cellspacing="0">
			<tr>
				<td align="center" valign="top">
					<div id="position">
						当前位置：系统管理 - 后台账号查询管理 -
						<s:if test="id == null">创建账号</s:if>
						<s:else>修改账号</s:else>
					</div>
					<form name="form1" method="post" action="${ctx}/admin/user!save.action">
						<input type="hidden" name="id" value="${id}">
						<table width="95%" border="0" cellspacing="2" cellpadding="2">
							<tr>
								<td class="name">
									<s:if test="id == null">创建账号</s:if>
									<s:else>修改账号</s:else>
								</td>
							</tr>
						</table>
						<table width="95%" border="0" cellspacing="1" cellpadding="2">
							<tr>
								<td width="100">
									<div class="item">
										用户名
									</div>
								</td>
								<td>
									<input name="loginName" type="text" size="20" value=${loginName
										} <s:if test="id != null">readonly="true"</s:if>>
								</td>
							</tr>
							<s:if test="id == null">
								<tr>
									<td width="100">
										<div class="item">
											密码
										</div>
									</td>
									<td>
										<input name="password" type="text" size="20" value=${password}>
									</td>
								</tr>
							</s:if>
							<tr>
								<td width="100">
									<div class="item">
										姓名
									</div>
								</td>
								<td>
									<input name="name" type="text" size="20" value=${name}>
								</td>
							</tr>
							<tr>
								<td width="100">
									<div class="item">
										邮箱
									</div>
								</td>
								<td>
									<input name="email" type="text" size="20" value=${email}>
								</td>
							</tr>
							<tr>
								<td width="100">
									<div class="item">
										电话
									</div>
								</td>
								<td>
									<input name="tel" type="text" size="20" value=${tel}>
								</td>
							</tr>
							<tr>
								<td width="100">
									<div class="item">
										账号类型
									</div>
								</td>
								<td>
									<c:forEach var="role" items="${extendAttributes['allRoles']}">
   											<input type="checkbox" name="roleId" value=${role.id} <c:forEach var="userrole" items="${roles}"><c:if test="${userrole.id ==role.id }">checked</c:if></c:forEach>
   											>${role.name }
									</c:forEach> 
								</td>
							</tr>
							<tr>
								<td width="100">
									<div class="item">
										部门
									</div>
								</td>
								<td>
									<input name="department" type="text" size="20"
										value=${department}>
								</td>
							</tr>
						</table>
						<table width="95%" border="0" cellspacing="2" cellpadding="2">
							<tr>
								<td align="center">
									<input type="submit" name="Submit2" value="提交">
									<input type="submit" name="Submit3" value="重置">
								</td>
							</tr>
						</table>
					</form>
				</td>
			</tr>
		</table>
	</body>
</html>
